import QtQuick
import QtQuick3D
Model{
    id:root
    Node {
        id: __materialLibrary__
    }

    enum State{
        OK,
        UnPlacable,
        Broken
    }

    property int state:BlockBase.OK


    source: "#Cube"

    materials: DefaultMaterial {
        id: defaultMaterial
        objectName: "Default Material"
        diffuseColor: {

            if(BlockBase.OK === root.state)
            {
                return "green"
            }

            if(BlockBase.UnPlacable === root.state)
            {
                return "yellow"
            }

            if(BlockBase.Broken === root.state)
            {
                return "red"
            }

        return "green"
        }

    }

}
